<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../../../assets/libs/jquery/jquery-3.6.1.min.js"></script>
</head>

<body>
  <div>Hello world!</div>
  <p>Hello world!</p>
  <input type="text" value="Hello world!">

  <script>
    // 获取、设置 innerHTML
    console.log($('div').html())
    $('div').html('<strong>Hello world!</strong>')

    // 获取、设置 innerText
    console.log($('p').text())
    $('p').text('<strong>Hello world!</strong>')

    // 获取、设置 input 的 value
    console.log($('input').val())
    $('input').val('Hello world! 2')
  </script>
</body>

</html>